home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / INCLUDES / I3DEXMDU.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  6.3 KB  |  129 lines

  1. /* $Id: I3DExMdu.h 1.15 1997/06/09 19:54:24 YannPC Exp $ */
  2. /*****************************************************************************\
  3. *                                                                             *
  4. * I3DExMdu.h                                                                          *
  5. *   I3DExModule definition                                                    *
  6. *                                                                             *
  7. *   External modules interface                                                *
  8. *                                                                             *
  9. *           Copyright (c) 1996, Fractal Design Corp. All rights reserved.     *
  10. *                                                                             *
  11. \*****************************************************************************/
  12.  
  13. #ifndef __I3DEXMDU__
  14. #define __I3DEXMDU__
  15.  
  16. #ifndef __I3DEX__
  17. #include "I3DEx.h"
  18. #endif
  19.  
  20. #ifndef __I3DSHSCN__
  21. #include "I3DShScn.h"
  22. #endif
  23.  
  24. #ifndef __I3DSHUTI__
  25. #include "I3DShUti.h"
  26. #endif
  27.  
  28. //****** Globally Unique Ids **************************************************
  29. DEFINE_GUID(IID_I3DExModule, 0x45bfb0a0, 0xba0f, 0x11cf, 0x99, 0x09, 0x00, 0x40, 0x05, 0x22, 0xbf, 0xcc);
  30.  
  31.  
  32. /*****************************************************************************\
  33. *  I3DExModule                                                                *
  34. *                                                                             *
  35. *   External modules interface                                                *
  36. *                                                                             *
  37. *                                                                             *
  38. \*****************************************************************************/
  39.  
  40. /*****************************************************************************\
  41. *  Theory:
  42. *
  43. *  Resources: 
  44.      In addition to the usual 'Comp' and 'PMAP' resources, 
  45.      you need to provide a 'Modu' resource of the same ID to specify parameters 
  46.      such as the 'MBAR' (Menu Bar) ID, the 'TBAR' (Tool Bar) ID, the Preferences
  47.      'View' ID, etc. See XAPI.r.
  48. *
  49. *  Preferences:
  50.      The Shell can read and write your Module Preferences data automatically
  51.      from/to the Preferences file, and gives this data to your Module using
  52.      the I3DExModule::SetPrefs() call just before calling I3DExModule::Edit().
  53.      1. In the 'Modu' resource, choose a Preferences View ID and a 'Prfs' ID 
  54.         (the 'Prfs' resource contains the default values if a Preferences
  55.         file has to be created from scratch by the Shell. To make a 'Prfs'
  56.                 resource, copy/paste the part of the Preferences File related to
  57.                 your Module into the 'Prfs' resource.
  58.          2. Build your Preferences View
  59.          3. Add to the Module's 'PMAP' the items of the View. You will note that
  60.             the same PMAP is used for the Module's View and its Preferences. This 
  61.                 is not a real problem as long as you use distinct IDs for the UI 
  62.                 elements (buttons, check boxes, etc.).
  63.  
  64.             If you do not wish to have Preferences, put 0 in the Preferences View ID
  65.             of the 'Modu' resource.
  66. *
  67. *  Drag and drop from Tool Bar:
  68.  
  69.  
  70. *
  71. *
  72. \*****************************************************************************/
  73.  
  74. // Message constants for the Properties Palette (see OnMessagePropsCallBack of GetPropertiesInfo())
  75. #define mShNewSelection 4000
  76. #define mShSelectionChanged 4001
  77. #define mShUpdateSelectionInfo 4002
  78. #define mShApplyButton 4003
  79. #define mShInvalidateCamera 4004
  80. #define mShRestoreButton 4005
  81.  
  82.  
  83. typedef void (*OnMessagePropsCallBack) (long messageID, long sourceID, PLATFORMEVENT* event, IShView* topView, void* privData);
  84. typedef void (*DrawNowPropsCallBack) (void* module);
  85.  
  86. #undef INTERFACE
  87. #define INTERFACE I3DExModule
  88.  
  89. DECLARE_INTERFACE_(I3DExModule, I3DExDataExchanger) {
  90.     // IUnknown methods
  91.   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  92.   STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  93.   STDMETHOD_(ULONG, Release) (THIS) PURE;
  94.   
  95.     // I3DExtension methods
  96.     STDMETHOD(ShellUtilitiesInit) (THIS_ IShUtilities* shellUtilities) PURE;
  97.     STDMETHOD_(I3DExtension*, Clone) (THIS) PURE;
  98.  
  99.   // I3DExDataExchanger methods
  100.     STDMETHOD_(ExtensionDataMap*, GetExtensionDataMap) (THIS) PURE;    // Return NULL if GetResID is to be used
  101.     STDMETHOD_(void*, GetExtensionDataBuffer) (THIS) PURE;
  102.   STDMETHOD(ExtensionDataChanged) (THIS) PURE;
  103.   STDMETHOD(HandleEvent) (THIS_ ULONG sourceID) PURE;
  104.     STDMETHOD_(short, GetResID) (THIS) PURE;
  105.  
  106.     // I3DExModule methods
  107.     STDMETHOD(SetPrefs) (THIS_ void* prefs) PURE;        // 'prefs' is a pointer given by the Shell on the Module's Preferences data block
  108.     STDMETHOD(Edit) (THIS_ IUnknown* element) PURE;
  109.     STDMETHOD(Import) (THIS_ IUnknown* element, void* parameters) PURE;
  110.     STDMETHOD(PrepareMenus) (THIS) PURE;
  111.     STDMETHOD_(BOOLEAN, OnMenuAction) (THIS_ IShContext* context, long actionNumber) PURE;
  112.     STDMETHOD_(BOOLEAN, OnKeyEvent) (THIS_ IShContext* context, PLATFORMEVENT* event) PURE;
  113.     STDMETHOD(OnToolAction) (THIS_ IShContext* context, short oldTool, short newTool) PURE;
  114.     STDMETHOD(Activate) (THIS_  IShContext* context, BOOLEAN entering) PURE;
  115.     STDMETHOD(Update) (THIS_  IShContext* context, I3DShScene* scene, long change) PURE;
  116.     STDMETHOD(Do) (THIS_ IShContext* context, ULONG message, void* data, void** result) PURE;
  117.     STDMETHOD_(BOOLEAN, LaunchToolDragAndDrop) (THIS_ short tool) PURE;
  118.     STDMETHOD_(BOOLEAN, GetZoomEffect) (THIS_ void* prevElem, void* nextElem, Boolean* zoomIn) PURE;
  119.     STDMETHOD_(BOOLEAN, PropertiesChanged) (THIS) PURE;    // Return TRUE if GetPropertiesInfo() should be called to update the the Properties Palette
  120.     STDMETHOD_(BOOLEAN, GetPropertiesInfo) (THIS_ short& viewAndPMapID, void*& dataBuffer, void*& privData, 
  121.                                                                         BOOLEAN& forceShowProperties,
  122.                                                                         OnMessagePropsCallBack& onMessageCallBack,         // The External Module should return its View callback here
  123.                                                                         DrawNowPropsCallBack drawNowPropsCallBack, void* module) PURE; // The Shell is giving this callback so that the External Modeler can redraw the Properties view immediately
  124.     STDMETHOD(DoApplyProperties) (THIS_ IShContext* context, IShView* topView, void* privData) PURE;
  125.     STDMETHOD(DoRestoreProperties) (THIS_ IShContext* context, IShView* topView, void* privData) PURE;
  126.   };
  127.  
  128. #endif
  129.